package learn;

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.apache.commons.io.input.BOMInputStream;

import java.io.*;

public class demo_csv {
    public static void main(String[] args) throws IOException {
        Reader in = new InputStreamReader(new BOMInputStream(new FileInputStream("demo.csv")));
        // Iterable<CSVRecord> records = CSVFormat.RFC4180.withHeader("时间", "弹幕模式", "字号大小", "颜色", "Unix格式时间戳", "弹幕种类", "发送者ID", "rowID").parse(in);
        Iterable<CSVRecord> records = CSVFormat.RFC4180.withFirstRecordAsHeader().parse(in);
        for (CSVRecord record : records) {
            if (record.get("时间").equals("65.04200")){
                System.out.println("find");
            }
        }

    }
}
